<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>添加经销商结算单</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 组件样式 -->
  <link rel="stylesheet" href="../../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../../css/index.css">
  <style>
    .el-input.is-disabled .el-input__inner {
      background-color: #F5F7FA;
      border-color: #E4E7ED;
      color: #606266;
      cursor: not-allowed;
    }
  </style>
</head>

<body>
  <div id="app" v-cloak class="minWidth">
    <el-form :model="form" ref="contract" :rules="rules" inline-message="true" style="width: 100%">
      <div class="table_titel">
        <div class="titel">一件代发价格单</div>
      </div>
      <el-descriptions :column="2" border size="small">
        </el-descriptions-item>
        <el-descriptions-item label="开始时间">
          <el-form-item prop="Start_Date">
            <el-date-picker v-model.trim="form.Start_Date" type="datetime" placeholder="请选择开始时间"
              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="结算时间">
          <el-form-item prop="End_Date">
            <el-date-picker v-model.trim="form.End_Date" type="datetime" placeholder="请选择结算时间"
              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <div class="table_titel">
        <div class="titel">价格单明细</div>
        <div class="operation">
          <el-button type="primary" size="small" @click="add_dealer_unitprice_detail">新增</el-button>
          <el-button type="danger" size="small" @click="remove_dealer_unitprice_detail">删除</el-button>
        </div>
      </div>
      <el-descriptions :column="2" border size="small" v-for="(item,index) in form.Children.dealer_unitprice_detail"
        :key="index">
        <el-descriptions-item label="商品名称">
          <el-form-item>
            <el-select @change="Change_Unit_Price($event,index)" v-model.trim="item.Article_SerialNumber" placeholder="请选择商品"
              filterable style="width: 100%">
              <el-option v-for="(ite,index) in shop" :key="index" :label="ite.Article_Name"
                :value="ite.Article_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="零售价">
          <el-form-item>
            <el-input v-model.trim="item.Unit_Price" disabled placeholder="零售价"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="结算单价">
          <el-form-item>
            <el-input v-model.trim="item.Balance_Unit_Price" placeholder="请输入销售单价"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="日供库存">
          <el-form-item>
            <el-input v-model.trim="item.Daily_Supply" style="width: 100%;" placeholder="请输入分配数量"></el-input>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <div style="margin-bottom: 90px;">
        <div class="table_titel">
          <div class="titel">适用经销商</div>
          <div class="operation">
            <el-button type="primary" size="small" @click="add_dealer_unitprice_storescope">新增</el-button>
            <el-button type="danger" size="small" @click="remove_dealer_unitprice_storescope">删除</el-button>
          </div>
        </div>
        <el-descriptions :column="2" border size="small"
          v-for="(item,index) in form.Children.dealer_unitprice_storescope" :key="index">
          <el-descriptions-item label="经销商">
            <el-form-item prop="Dealer_SerialNumber">
              <el-select v-model.trim="item.Dealer_SerialNumber" placeholder="请选择经销商" filterable style="width: 100%">
                <el-option v-for="(item,index) in dealer" :key="index" :label="item.Dealer_Name"
                  :value="item.Dealer_SerialNumber"></el-option>
              </el-select>
            </el-form-item>
          </el-descriptions-item>
        </el-descriptions>
      </div>
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <el-button type="success" @click="onExcel">导入</el-button>
        <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  <!-- 依赖脚本 -->
  <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../../js/utils.js"></script>
  <script type="text/javascript" src="../../../../js/ID_Validity.js"></script>
  <script type="text/javascript" src="../../../../js/FileSaver.min.js"></script>
  <script type="text/javascript" src="../../../../js/FileSaver.js"></script>
  <script type="text/javascript" src="../../../../js/xlsx.full.min.js"></script>
  <script type="text/javascript" src="./js/Add.js"></script>
</body>

</html>